package com.hxm.appGenealogy.service;

import com.hxm.appGenealogy.Function.PeopleFunction;
import com.hxm.appGenealogy.entity.People;
import com.hxm.appGenealogy.entity.ResponDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Service
@Transactional(isolation = Isolation.READ_COMMITTED,propagation = Propagation.REQUIRES_NEW)
public class UserService {

    @Autowired
    private PeopleFunction peopleFunction;

    public ResponDataVo getUser( People people){
        People people1 = peopleFunction.peopleGetByid(people.getId());
        return new ResponDataVo(people1);
    }

    public ResponDataVo updateByid(People people){

        peopleFunction.updateByid(people);
        return new ResponDataVo(people);
    }
}
